﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class btnScript : MonoBehaviour {

	// Use this for initialization
	void Start () {
        Button btn = this.GetComponent<Button>();
        btn.onClick.AddListener(delegate ()
        {
            this.OnClick(this.gameObject);
        });
	
	}
    public void OnClick(GameObject obj) {
        switch (obj .name ) {
            case "Button1":
                print("111");
                break;
            case "Button2":
                print("222");
                break;
            case "Button3":
                print("333");
                break;
            case "Button4":
                print("444");
                break;
            case "Button5":
                print("555");
                break;
        }

    }
	
	// Update is called once per frame
	void Update () {
	
	}
}
